package itHeima.lesson6;

public class demo6 {
    /**
     * 数组反转
     * 【1,2,3,4,5,6】
     * 【6,5,4,3,2,1】
     */

    public static void main(String[] args) {
        int[] arr = {10, 20, 30, 40, 50};

        for (int i = 0, j = arr.length - 1; i < j; i++, j--) {
            int temp = arr[j];
            arr[j] = arr[i];
            arr[i] = temp;
        }
        for (int i = 0;i< arr.length;i++){
            System.out.println(arr[i] + "   ");
        }
    }
}

